# -*- coding: UTF-8 -*-    
# Author:yangshuoshuo
# FileName:pydantic01
# DateTime:2024/7/21 14:01
# SoftWare: PyCharm
from pydantic import BaseModel
from pydantic import ValidationError, EmailStr, Field


class User(BaseModel):
    name: str
    age: int
    email: EmailStr


if __name__ == '__main__':
    try:
        tom = User(name="tom", age=10, email="aaaqq.com")
        print(tom)
    except ValidationError as e:
        print(e.json())